/*
 * Copyright (C) 2022 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "accessibility_gesture_event_handler.h"
#include "accessible_ability_manager_service.h"
#include "accessibility_screen_reader_service.h"
#include "utils.h"

#include "flite.h" //tts

#include "audio_stream_info.h" //AudioStreamType
#include "audio_renderer.h" //AudioRenderer
#include "accessibility_flite_player.h"
#include "accessibility_espeak_player.h"
#include <vector>

#include "speak_lib.h"
#include "accessibility_espeak_proxy.h"

#ifndef ESPEAK_TAG
#define ESPEAK_TAG "ESPEAK_TAG| "
#endif

//调用C的库函数
extern "C"{

/**
* @Description: declare the function which defined in libflite_cmu_us_kal.a library of flite, to tell the compiler.
*/
cst_voice *register_cmu_us_kal(const char *voxdir); //该函数没有在flite头文件中声明。。。

}

namespace OHOS {
namespace Accessibility {

namespace {
    const std::string SPEAK_HOME = "返回桌面";
    const std::string SPEAK_BACK = "返回上一级";
    const std::string SPEAK_RECENT = "最近任务";
    const std::string SPEAK_MENU = "菜单键";
    const std::string SPEAK_TASKMANAGER = "任务管理器";
    const std::string SPEAK_APPSELECT = "应用选择";
    const std::string SPEAK_CAMERA = "打开相机";
    const std::string SPEAK_COPY = "复制";
    const std::string SPEAK_PASTE = "粘贴";
    const std::string SPEAK_CUT = "剪切";
    const std::string SPEAK_CALL = "拨打电话";
    const std::string SPEAK_MUTE = "已静音";
    const std::string SPEAK_NULL = "";

    std::map<GestureType, std::pair<ActionType, std::string>> gestureActionMap = {
        {GestureType::GESTURE_SWIPE_UP_THEN_DOWN, 
            {ActionType::ACCESSIBILITY_ACTION_HOME, SPEAK_HOME}},
        {GestureType::GESTURE_SWIPE_LEFT_THEN_RIGHT, 
            {ActionType::ACCESSIBILITY_ACTION_BACK, SPEAK_BACK}},
        {GestureType::GESTURE_SWIPE_RIGHT_THEN_LEFT, 
            {ActionType::ACCESSIBILITY_ACTION_RECENTTASK, SPEAK_RECENT}},
        // 测试最近任务究竟是哪个键
        {GestureType::GESTURE_SWIPE_DOWN_THEN_UP,
            {ActionType::ACCESSIBILITY_ACTION_RECENTTASK1, SPEAK_MENU}},
        {GestureType::GESTURE_SWIPE_UP_THEN_LEFT,
            {ActionType::ACCESSIBILITY_ACTION_RECENTTASK2, SPEAK_TASKMANAGER}},
        {GestureType::GESTURE_SWIPE_UP_THEN_RIGHT,
            {ActionType::ACCESSIBILITY_ACTION_RECENTTASK3, SPEAK_APPSELECT}},
        {GestureType::GESTURE_SWIPE_DOWN_THEN_LEFT,
            {ActionType::ACCESSIBILITY_ACTION_CAMERA, SPEAK_CAMERA}},
        {GestureType::GESTURE_SWIPE_DOWN_THEN_RIGHT,
            {ActionType::ACCESSIBILITY_ACTION_COPY, SPEAK_COPY}},
        {GestureType::GESTURE_SWIPE_LEFT_THEN_UP,
            {ActionType::ACCESSIBILITY_ACTION_PASTE, SPEAK_PASTE}},
        {GestureType::GESTURE_SWIPE_LEFT_THEN_DOWN,
            {ActionType::ACCESSIBILITY_ACTION_CUT, SPEAK_CUT}},
        {GestureType::GESTURE_SWIPE_RIGHT_THEN_UP,
            {ActionType::ACCESSIBILITY_ACTION_CALL, SPEAK_CALL}},
        {GestureType::GESTURE_SWIPE_RIGHT_THEN_DOWN,
            {ActionType::ACCESSIBILITY_ACTION_MUTE, SPEAK_MUTE}}
    };
}

/*test flite*/
bool test_play_wave(cst_wave *wave){
    HILOG_DEBUG();
    if (wave == nullptr) {
        HILOG_ERROR("wave is nullptr");
        return false;
    }

    /*AudioStandard::ContentType contentType = AudioStandard::ContentType::CONTENT_TYPE_SPEECH;
    AudioStandard::StreamUsage streamUsage = AudioStandard::StreamUsage::STREAM_USAGE_ACCESSIBILITY;
    AudioStandard::AudioRendererOptions rendererOptions = {};
    rendererOptions.streamInfo.encoding = AudioStandard::AudioEncodingType::ENCODING_PCM;
    rendererOptions.streamInfo.samplingRate = static_cast<AudioStandard::AudioSamplingRate>(cst_wave_sample_rate(wave));
    rendererOptions.streamInfo.format = AudioStandard::AudioSampleFormat::SAMPLE_S16LE;
    rendererOptions.streamInfo.channels = static_cast<AudioStandard::AudioChannel>(cst_wave_num_channels(wave));
    rendererOptions.rendererInfo.contentType = contentType;
    rendererOptions.rendererInfo.streamUsage = streamUsage;
    rendererOptions.rendererInfo.rendererFlags = 0;
    HILOG_DEBUG("encoding: %{public}d, samplingRate: %{public}d, format: %{public}d, channels: %{public}d", rendererOptions.streamInfo.encoding, rendererOptions.streamInfo.samplingRate, rendererOptions.streamInfo.format, rendererOptions.streamInfo.channels);

    std::unique_ptr<AudioStandard::AudioRenderer> audioRenderer = AudioStandard::AudioRenderer::Create(rendererOptions);
    if(audioRenderer == nullptr){
        HILOG_ERROR("audioRenderer is nullptr");
        return false;
    }*/
    
    AudioStandard::AudioStreamType streamType = AudioStandard::AudioStreamType::STREAM_ACCESSIBILITY;
    std::unique_ptr<AudioStandard::AudioRenderer> audioRenderer = AudioStandard::AudioRenderer::Create(streamType);
    if(audioRenderer == nullptr){
        HILOG_ERROR("audioRenderer is nullptr");
        return false;
    }

    AudioStandard::AudioRendererParams rendererParams;
    rendererParams.sampleFormat = AudioStandard::AudioSampleFormat::SAMPLE_S16LE;
    rendererParams.sampleRate = static_cast<AudioStandard::AudioSamplingRate>(cst_wave_sample_rate(wave));
    rendererParams.channelCount = static_cast<AudioStandard::AudioChannel>(cst_wave_num_channels(wave));
    rendererParams.encodingType = AudioStandard::AudioEncodingType::ENCODING_PCM;
    audioRenderer->SetParams(rendererParams);
    HILOG_DEBUG("sampleFormat: %{public}d, sampleRate: %{public}d, channelCount: %{public}d, encodingType: %{public}d",
        rendererParams.sampleFormat, rendererParams.sampleRate, rendererParams.channelCount, rendererParams.encodingType);

    if(!audioRenderer->Start()){
        HILOG_ERROR("audioRenderer start failed");
        return false;
    }
    //size_t bufferLen = 0;
    //audioRenderer->GetBufferSize(bufferLen);
    size_t bytesToWrite = cst_wave_num_samples(wave) * cst_wave_num_channels(wave) * sizeof(short); //cst_wave_io.c 244行
    size_t bytesWritten = 0;
    size_t minBytes = 4;
    //采用内存复制对样本数据进行类型转换
    std::vector<uint8_t> uint8Buffer(bytesToWrite); // 创建 uint8_t 数组   
    memcpy(uint8Buffer.data(), static_cast<uint8_t*>(static_cast<void*>(cst_wave_samples(wave))), bytesToWrite); // 使用 memcpy 转换内存块

    while ((bytesWritten < bytesToWrite) && ((bytesToWrite - bytesWritten) > minBytes)) {
        bytesWritten += audioRenderer->Write(uint8Buffer.data() + bytesWritten, bytesToWrite - bytesWritten); // write第一个参数是uint8_t*类型
        if (bytesWritten < 0)
            break;
    }
    HILOG_DEBUG("bytesWritten: %{public}zu, bytesToWrite: %{public}zu", bytesWritten, bytesToWrite);

    if (!audioRenderer->Stop()) {
        HILOG_DEBUG("audioRenderer stop failed");
    }

    if (!audioRenderer->Release()) {
        HILOG_DEBUG("audioRenderer release failed");
    }

    HILOG_DEBUG("play_wave end");
    return true;
}

/**
 * @Description: test flite
 */
void test_flite(){
    // test tts
    HILOG_DEBUG();
    int64_t tts_start_time = Utils::GetSystemTime();
    cst_voice *v;
    flite_init();
    v = register_cmu_us_kal(nullptr);
    cst_wave *wave = flite_text_to_wave("here comes an event!", v);
    int64_t tts_end_time = Utils::GetSystemTime();
    Singleton<FlitePlayer>::GetInstance().Play(wave);
    int64_t play_end_time = Utils::GetSystemTime();
    HILOG_DEBUG("play_wave success, tts time: %{public}" PRId64 ", play time: %{public}" PRId64 , tts_end_time - tts_start_time, play_end_time - tts_end_time);

    //float seconds = flite_text_to_speech("here comes an event!",v,"play");
    //HILOG_DEBUG("tts time:%{public}f",seconds);
}
/*end test flite*/


/*test espeak*/
// int SynthCallback(short *wav, int numsamples, espeak_EVENT *events)
// {
//     HILOG_DEBUG(ESPEAK_TAG "numsamples: %{public}d", numsamples);
//     //合成最后一次调用回调wave is null，numsamples=0
//     if(wav==NULL){
//         HILOG_DEBUG(ESPEAK_TAG "wave is null");
//         return 0;
//     }
//     while(events->type != 0){
//         HILOG_DEBUG(ESPEAK_TAG "espeak_EVENT type: %{public}d", events->type);
//         events++;
//     }

//     if(numsamples<=0){
//         HILOG_DEBUG(ESPEAK_TAG "numsamples <= 0");
//         return 0;
//     }

//     Singleton<EspeakPlayer>::GetInstance().Play(wav, numsamples);
//     return 0; // 0=continue synthesis,  1=abort synthesis.
// }

// void test_espeak(){
//     HILOG_DEBUG(ESPEAK_TAG);
//     HILOG_DEBUG(ESPEAK_TAG "espeak test start");
//     int test_add_6 = espeak_Test(10);
//     HILOG_DEBUG(ESPEAK_TAG "espeak test end, test_add_6: %{public}d", test_add_6);

//     // 初始化espeak
//     const char *datapath = "/etc";
//     int samplerate=espeak_Initialize(AUDIO_OUTPUT_SYNCHRONOUS, 0, datapath, 0);
//     HILOG_DEBUG(ESPEAK_TAG "espeak_Initialize samplerate: %{public}d", samplerate);

//     // 中断EspeakPlayer,并设置参数
//     auto &espeakPlayer = Singleton<EspeakPlayer>::GetInstance();
//     espeakPlayer.Interrupt();
//     espeakPlayer.SetParams(AudioStandard::AudioChannel::MONO, samplerate);

//     // voice language
//     int set_voice_ret = espeak_SetVoiceByName("zh");
//     if(set_voice_ret != 0){
//         HILOG_ERROR("espeak_SetVoiceByName failed, ret: %{public}d", set_voice_ret);
//     }
//     espeak_SetParameter(espeakRATE, 175, 0); // 设置语速  
//     espeak_SetParameter(espeakVOLUME, 100, 0); // 设置音量 

//     espeak_SetSynthCallback(SynthCallback);
    
//     // 合成音频
//     std::string text = "你好，世界！";
//     int ret = espeak_Synth(text.c_str(), text.length()+1, 0, POS_CHARACTER, 0, espeakCHARS_UTF8, NULL, NULL);
//     HILOG_DEBUG(ESPEAK_TAG "espeak_Synth ret: %{public}d", ret);
//     espeak_Synchronize(); // 等待合成完成
//     espeak_Terminate(); // 结束合成

//     HILOG_DEBUG(ESPEAK_TAG "test_espeak end");
// }

void test_espeak_plus()
{
    HILOG_DEBUG(ESPEAK_TAG "test_espeak_plus start");
    EspeakProxy::Synthesize("你好，风起云涌的世界！");
    HILOG_DEBUG(ESPEAK_TAG "test_espeak_plus end");
}
/*end test espeak*/


GestureEventHandler::GestureEventHandler()
{
    HILOG_DEBUG("GestureEventHandler::Init");
    pointerEvent_ = MMI::PointerEvent::Create();
    pointerEvent_->SetSourceType(MMI::PointerEvent::SOURCE_TYPE_TOUCHSCREEN);
    //新建的pointerevent是空的，GetPointerId为-1
    MMI::PointerEvent::PointerItem pointer = {};
    pointer.SetPointerId(0);
    pointerEvent_->SetPointerId(0);
    pointerEvent_->AddPointerItem(pointer);
}

GestureEventHandler::~GestureEventHandler()
{
    HILOG_DEBUG("GestureEventHandler::Release");
    pointerEvent_ = nullptr;
}

void GestureEventHandler::OnGestureEvent(const AccessibilityEventInfo &uiEvent)
{
    GestureType gestureType=uiEvent.GetGestureType();
    HILOG_DEBUG("gestureType[%{public}d]", gestureType);

    switch (gestureType){
        case GestureType::GESTURE_INVALID:
            HandleInvalidGestureEvent(uiEvent);
            break;
        case GestureType::GESTURE_SWIPE_UP:
        case GestureType::GESTURE_SWIPE_DOWN:
        case GestureType::GESTURE_SWIPE_LEFT:
        case GestureType::GESTURE_SWIPE_RIGHT:
            HandleFocusMove(uiEvent);
            break;
        case GestureType::GESTURE_DOUBLETAP:
            HandleDoubleTapGestureEvent(uiEvent);
            break;
        case GestureType::GESTURE_TWO_FINGER_LONG_PRESS:
            HILOG_DEBUG("GestureType::GESTURE_TWO_FINGER_LONG_PRESS");
            Singleton<ScreenReader>::GetInstance().SpeakFullScreen();
            break;
        case GestureType::GESTURE_FOUR_FINGER_SWIPE_UP:
        case GestureType::GESTURE_FOUR_FINGER_SWIPE_DOWN:
        case GestureType::GESTURE_FOUR_FINGER_SWIPE_LEFT:
        case GestureType::GESTURE_FOUR_FINGER_SWIPE_RIGHT:
            HandleFourFingerSwipeGestureEvent(gestureType);
            break;
        // 其他手势（通过多模重新注入keyevent）
        default:
            ExecuteAction(gestureType);
            // HILOG_WARN("GestureEventHandler::OnGestureEvent, default case, need check.");
            break;
    }
}

void GestureEventHandler::HandleInvalidGestureEvent(const AccessibilityEventInfo &uiEvent)
{
    HILOG_ERROR("GESTURE_INVALID");
    return;
}

void GestureEventHandler::HandleFocusMove(const AccessibilityEventInfo &uiEvent)
{
    HILOG_DEBUG();
    int64_t start_time = Utils::GetSystemTime();
    int64_t end_time;
    // find focus move elementInfo
    AccessibilityElementInfo newAccessibilityInfoResult = {};
    auto &aams=Singleton<AccessibleAbilityManagerService>::GetInstance();
    GestureType gestureType=uiEvent.GetGestureType();
    switch (gestureType)
    {
    case GestureType::GESTURE_SWIPE_UP:
        newAccessibilityInfoResult=aams.FocusMoveSearch(FocusMoveDirection::UP);
        break;
    case GestureType::GESTURE_SWIPE_DOWN:
        newAccessibilityInfoResult=aams.FocusMoveSearch(FocusMoveDirection::DOWN);
        break;
    case GestureType::GESTURE_SWIPE_LEFT:
        newAccessibilityInfoResult=aams.FocusMoveSearch(FocusMoveDirection::LEFT);
        break;
    case GestureType::GESTURE_SWIPE_RIGHT:
        newAccessibilityInfoResult=aams.FocusMoveSearch(FocusMoveDirection::RIGHT);
        break;
    default:
        HILOG_ERROR("unexcepted swipe gesture type");
        break;
    }
    if(newAccessibilityInfoResult.GetAccessibilityId()==AccessibilityElementInfo::UNDEFINED_ACCESSIBILITY_ID){
        HILOG_ERROR("newAccessibilityInfoResult is null");
        return;
    }
    // draw focus
    auto &sr=Singleton<ScreenReader>::GetInstance();
    if(gestureType==GestureType::GESTURE_SWIPE_UP){
        sr.DrawFocus(newAccessibilityInfoResult, 1);
    }else if(gestureType==GestureType::GESTURE_SWIPE_DOWN){
        sr.DrawFocus(newAccessibilityInfoResult, -1);
    }else{
        sr.DrawFocus(newAccessibilityInfoResult, -1); // 左右滑动存在不可聚焦情况（桌面），寻找第一个可聚焦的子节点
    }
    end_time = Utils::GetSystemTime();
    HILOG_DEBUG(PERFORMANCE_TEST "Handlefocusmove cost time: %{public}lld ms", end_time - start_time);
}

bool GestureEventHandler::HandleDoubleTapGestureEvent(const AccessibilityEventInfo &uiEvent)
{
    HILOG_DEBUG();
    int64_t start_time = Utils::GetSystemTime();
    int64_t end_time;
    AccessibilityElementInfo elementInfo = {};
    auto &aams=Singleton<AccessibleAbilityManagerService>::GetInstance();
    if(!aams.FindFocusedElement(elementInfo)){
        HILOG_DEBUG("find focused element failed");
        return false;
    }
    if(elementInfo.GetAccessibilityId()==AccessibilityElementInfo::UNDEFINED_ACCESSIBILITY_ID){
        HILOG_DEBUG("focus on wrong elementid[%{public}" PRId64 "]", aams.GetFocusElementId());
        return false;
    }
    int64_t elementId=elementInfo.GetAccessibilityId();
    int32_t windowId=elementInfo.GetWindowId();
    HILOG_DEBUG("focus elementid[%{public}" PRId64 "], uievent elementid[%{public}" PRId64 "]", elementId,uiEvent.GetElementInfo().GetAccessibilityId());

    if(elementInfo.IsClickable()){
        HILOG_DEBUG("doubletap on uievent with componentId[%{public}" PRId64 "], windowId[%{public}d]",
        elementId, windowId);
        aams.ExecuteActionOnAccessibilityFocused(ACCESSIBILITY_ACTION_CLICK);
        end_time = Utils::GetSystemTime();
        HILOG_DEBUG(PERFORMANCE_TEST "HandleDoubleTap cost time: %{public}lld ms", end_time - start_time);
        return true;
    }
    HILOG_DEBUG("current element is not clickable");
    int64_t clickableChildId=aams.FindClickableChildElement(elementInfo);
    if(clickableChildId==AccessibilityElementInfo::UNDEFINED_ACCESSIBILITY_ID){
        HILOG_DEBUG("find clickable child element failed");
        return false;
    }
    aams.ExecuteActionOnElement(clickableChildId, windowId, ACCESSIBILITY_ACTION_CLICK);
    end_time = Utils::GetSystemTime();
    HILOG_DEBUG(PERFORMANCE_TEST "HandleDoubleTap cost time: %{public}lld ms", end_time - start_time);
    return true;
}

bool GestureEventHandler::HandleFourFingerSwipeGestureEvent(const GestureType gestureType)
{
    HILOG_DEBUG("gestureType[%{public}d]", gestureType);
    bool ret = false;
    switch (gestureType)
    {
    case GESTURE_FOUR_FINGER_SWIPE_UP:
        ret = EspeakProxy::NextVoice(-1);
        break;
    case GESTURE_FOUR_FINGER_SWIPE_DOWN:
        ret = EspeakProxy::NextVoice(1);
        break;
    case GESTURE_FOUR_FINGER_SWIPE_LEFT:
        ret = EspeakProxy::NextLanguage(-1);
        break;
    case GESTURE_FOUR_FINGER_SWIPE_RIGHT:
        ret = EspeakProxy::NextLanguage(1);
        break;
    default:
        HILOG_DEBUG("gestureType[%{public}d] not found", gestureType);
        break;
    }
    return ret;
}

void GestureEventHandler::ExecuteAction(const GestureType gestureType)
{
    HILOG_DEBUG("gestureType[%{public}d]", gestureType);
    int64_t start_time = Utils::GetSystemTime();
    int64_t end_time;
    if(gestureActionMap.find(gestureType)!=gestureActionMap.end()){
        ActionType actionType = gestureActionMap[gestureType].first;
        std::string speakContent = gestureActionMap[gestureType].second;
        HILOG_DEBUG("actionType[%{public}d], speakContent[%{public}s]", actionType, speakContent.c_str());
        if(!Singleton<ScreenReader>::GetInstance().ExecuteAction(actionType)){
            HILOG_ERROR("ExecuteAction failed");
            return;
        }
        EspeakProxy::Synthesize(speakContent.c_str());
        end_time = Utils::GetSystemTime();
        HILOG_DEBUG(PERFORMANCE_TEST "ExecuteAction cost time: %{public}lld ms", end_time - start_time);
        return;
    }
    HILOG_ERROR("gestureType[%{public}d] not found", gestureType);
}

void GestureEventHandler::ExecuteActionWithSimulateClickForBack(const GestureType gestureType)
{
    HILOG_DEBUG();

    // start 模拟单击返回、桌面、最近任务
    if(!pointerEvent_){
        HILOG_DEBUG("pointerEvent_ is null");
        return;
    }
    MMI::PointerEvent::PointerItem pointer = {};
    if(!pointerEvent_->GetPointerItem(pointerEvent_->GetPointerId(), pointer)){
        HILOG_WARN("GetPointerItem(%{public}d) failed", pointerEvent_->GetPointerId());
    }

    if (gestureType == GestureType::GESTURE_SWIPE_UP_THEN_LEFT || gestureType == GestureType::GESTURE_SWIPE_DOWN_THEN_LEFT || gestureType == GestureType::GESTURE_SWIPE_DOWN_THEN_RIGHT)
    {
        if (gestureType == GestureType::GESTURE_SWIPE_UP_THEN_LEFT)
        {
            pointer.SetDisplayX(359);
            pointer.SetDisplayY(1244);
        }
        if (gestureType == GestureType::GESTURE_SWIPE_DOWN_THEN_LEFT)
        {
            pointer.SetDisplayX(206);
            pointer.SetDisplayY(1244);
        }
        if (gestureType == GestureType::GESTURE_SWIPE_DOWN_THEN_RIGHT)
        {
            pointer.SetDisplayX(513);
            pointer.SetDisplayY(1244);
        }
        // 模拟down
        int64_t time = Utils::GetSystemTime() * 1000;
        pointer.SetDownTime(time);
        // 根据日志
        pointer.SetWindowX(360);
        pointer.SetWindowY(36);
        pointer.SetTargetWindowId(9);
        pointerEvent_->SetActionTime(time);
        pointerEvent_->SetActionStartTime(time);
        pointerEvent_->RemovePointerItem(pointerEvent_->GetPointerId());
        pointerEvent_->AddPointerItem(pointer);
        HILOG_DEBUG("pointer id [%{public}d]", pointerEvent_->GetPointerId());
        pointerEvent_->SetPointerAction(MMI::PointerEvent::POINTER_ACTION_DOWN);
        EventTransmission::OnPointerEvent(*pointerEvent_);

        // 模拟up
        // MMI::PointerEvent::PointerItem pointerUp = {};
        // if(!pointerEvent_->GetPointerItem(pointerEvent_->GetPointerId(), pointerUp)){
        //     HILOG_WARN("GetPointerItem(%{public}d) failed", pointerEvent_->GetPointerId());
        // }
        // int64_t time2 = Utils::GetSystemTime() * 1000;
        // pointerUp.SetPressed(false);
        // pointerUp.SetDownTime(time2);
        // pointerEvent_->SetActionTime(time2);
        // pointerEvent_->RemovePointerItem(pointerEvent_->GetPointerId());
        // pointerEvent_->AddPointerItem(pointerUp);
        pointerEvent_->SetPointerAction(MMI::PointerEvent::POINTER_ACTION_UP);
        EventTransmission::OnPointerEvent(*pointerEvent_);
        return;
    }
    // end

    // if(gestureActionMap.find(gestureType)!=gestureActionMap.end()){
    //     ActionType actionType = gestureActionMap[gestureType];
    //     if(!Singleton<ScreenReader>::GetInstance().ExecuteAction(actionType)){
    //         HILOG_ERROR("ExecuteAction failed");
    //     }
    // }
    HILOG_DEBUG("not found, need check");
}

}// namespace Accessibility
}// namespace OHOS
